package jpa.entitys.promis.construction;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the COST_TXN_STATUS_HISTORY database table.
 * 
 */
@Embeddable
public class CostTxnStatusHistoryPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="MODEL_CODE", unique=true, nullable=false, length=100)
	private String modelCode;

	@Column(unique=true, nullable=false, precision=22)
	private long revision;

	@Column(name="RUNNING_NO", unique=true, nullable=false, precision=22)
	private long runningNo;

    public CostTxnStatusHistoryPK() {
    }
	public String getModelCode() {
		return this.modelCode;
	}
	public void setModelCode(String modelCode) {
		this.modelCode = modelCode;
	}
	public long getRevision() {
		return this.revision;
	}
	public void setRevision(long revision) {
		this.revision = revision;
	}
	public long getRunningNo() {
		return this.runningNo;
	}
	public void setRunningNo(long runningNo) {
		this.runningNo = runningNo;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof CostTxnStatusHistoryPK)) {
			return false;
		}
		CostTxnStatusHistoryPK castOther = (CostTxnStatusHistoryPK)other;
		return 
			this.modelCode.equals(castOther.modelCode)
			&& (this.revision == castOther.revision)
			&& (this.runningNo == castOther.runningNo);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.modelCode.hashCode();
		hash = hash * prime + ((int) (this.revision ^ (this.revision >>> 32)));
		hash = hash * prime + ((int) (this.runningNo ^ (this.runningNo >>> 32)));
		
		return hash;
    }
}